package com.zhentao.controller;

import com.zhentao.pojo.UserApp;
import com.zhentao.service.UserAppService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/user")
public class Usercontroller {
    @Resource
    private UserAppService userAppService;

    @RequestMapping("/login")
    public String login(@RequestParam("username") String username,@RequestParam("password") String password){
        UserApp userApp=userAppService.login(username,password);
        if (userApp!=null){
            return "登陆成功";
        }else{
            return "用户名或密码错误";
        }
    }

}
